package library

import (
	"fmt"
	"time"
)

// 获取用户key
func GetUserKey(appId int64, userId int64) (key string) {
	key = fmt.Sprintf("%d:%d", appId, userId)
	return
}

// 生成用户在线状态key值，redis使用
const (
	UserOnlinePrefix    = "userol:"
	UserOnlineCacheTime = 24 * 60 * 60 * time.Second
)

func GenUserOnlineKey(appId int64, userId int64) (key string) {
	key = fmt.Sprintf("%s%d%d", UserOnlinePrefix, appId, userId)
	return
}
